#ifndef MAPLABEL_H
#define MAPLABEL_H

#define LEFT 1
#define RIGHT 2
#define NONE 0

#include<mainwindow.h>
#include<QMouseEvent>
#include<QDebug>
#include<QLabel>
#include<QList>
#include<QListIterator>
#include<QPicture>
#include<QPixmap>
#include<QRadioButton>


class MapLabel : public QLabel{
public:
    MapLabel(const QString &text, QWidget *parent=nullptr,int width=5,int height=5);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void init();
    void setpainterstatus(int sta);
    int w;
    int h;
protected:
    int mousestatus;
    QPainterPath nullpath;
    QPainterPath brickspath;
    QPainterPath waypath;
    QPoint start;
    QPoint end;
    int status[120][120];
    void setMapPath();
    bool isinit=false;
    int aa;//当前鼠标所指向的第aa bb个块
    int bb;
    QPixmap mappic;
    int painterstatus;
    void paintnow();
    void paintnow(int x,int y,int sta);
    void setstartpoint(int x,int y);
    void setendpoint(int x,int y);
    bool shutevent;

};


#endif // MAPLABEL_H
